const fetchPost = (url, params) => {
  let result = fetch('../servlet', {
    method: 'POST',
    headers: {
      'content-type': 'application/x-www-form-urlencoded;charset=UTF-8'
    },
    body: `extSvrName=${url}&paras=${params}&service=InvokeService&mode=1&isYES2=true`
  })
    .then((res) => res.json())
    .then((res) => {
      return res
    })
  return result
}

const Api = {
  post: fetchPost // post请求
}
export default Api
